
#options = /d2 /od /mf /5r /w2 /dDEBUG
options = /oailrte /mf /5r /s /w2

#tasm_options = /ml /m /w2 /z /zi
tasm_options = /ml /m /w2 /z /zn

# Translator definition.
CC = wcc386 $(options)
CPPC = wpp386 $(options)
ASM = tasmx $(tasm_options)
HPP = h2ash -P -qi
link = wlink system dos4g debug all

.EXTENSIONS:
.EXTENSIONS: .exe .lib .obj .asm .ash .cpp .c .hpp .h

# Target dependencies.
ravage_obj = ravage.obj &
             face.obj &
             game.obj &
             gengine.obj &
             gclass.obj &
             diskio.obj &
             objects.obj &
             xlib.obj &
             xlibasm.obj &
             input.obj &
             sound.obj &
             memory.obj &
             error.obj &
             timer.obj &
             vtimer.obj &
             stuff.obj

setup_obj =     setup.obj &
                s_face.obj &
                stuff.obj &
                timer.obj &
                diskio.obj &
                input.obj &
                memory.obj &
                xlib.obj &
                xlibasm.obj &
                sound.obj &
                error.obj


# MOD PLAYER files
Mod_lib         = mikmod\mikmod.lib

# Explicit rules
ravage.exe : $(ravage_obj) .autodepend
        %create $*.lnk
        for %i in ($(ravage_obj)) do %append $*.lnk FILE %i
        for %i in ($(Mod_lib)) do %append $*.lnk LIBRARY %i
        $(link) name ravage.exe @$* OPTION STACK=16k

setup.exe : $(setup_obj) .autodepend
        %create $*.lnk
        for %i in ($(setup_obj)) do %append $*.lnk FILE %i
        for %i in ($(Mod_lib)) do %append $*.lnk LIBRARY %i
        $(link) name setup.exe @$* OPTION STACK=16k

vtimer.obj : .autodepend
        $(CC) /zu $*

xlibasm.obj : xlib.ash .autodepend
        $(ASM) $*


# Implicit rules
.hpp.ash: .autodepend
	$(HPP) $<

.cpp.obj: .autodepend
        $(CPPC) $<

.c.obj: .autodepend
        $(CC) $<

.asm.obj: .autodepend
        $(ASM) $<



